home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / kupidon-strike.swf / scripts / frame_182 / PlaceObject2_271_2011 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2011-12-21  |  1.7 KB  |  63 lines

  1. onClipEvent(enterFrame){
  2.    if(this.active)
  3.    {
  4.       if(move_delay >= 0)
  5.       {
  6.          move_delay--;
  7.       }
  8.       if(this.moveble && move_delay < 0)
  9.       {
  10.          if(c_path <= 0)
  11.          {
  12.             move_direction = -1;
  13.          }
  14.          if(c_path >= move_path)
  15.          {
  16.             move_direction = 1;
  17.          }
  18.          if(move_direction == 1)
  19.          {
  20.             c_path -= move_speed;
  21.             _X = _X + move_speed * Math.sin(move_angle * 0.017453292519943295);
  22.             _Y = _Y - move_speed * Math.cos(move_angle * 0.017453292519943295);
  23.          }
  24.          if(move_direction == -1)
  25.          {
  26.             c_path += move_speed;
  27.             _X = _X - move_speed * Math.sin(move_angle * 0.017453292519943295);
  28.             _Y = _Y + move_speed * Math.cos(move_angle * 0.017453292519943295);
  29.          }
  30.       }
  31.       if(!_root.stoned && pretest == true)
  32.       {
  33.          pretest = false;
  34.          _root.do_sound("sHeart-stone",true);
  35.          rem(1);
  36.       }
  37.       ti = 1;
  38.       while(ti < 6)
  39.       {
  40.          x = _root.bullet._x + _root.bullet.vector.x / ti * 0.9800000000000004;
  41.          y = _root.bullet._y - _root.bullet.vector.y / ti * 0.9800000000000004 - _root.gravity;
  42.          if(this.hitTest(x,y,true))
  43.          {
  44.             if(!_root.stoned)
  45.             {
  46.                pretest = true;
  47.             }
  48.          }
  49.          ti++;
  50.       }
  51.       i = 0;
  52.       while(i < _root.tohit.length)
  53.       {
  54.          if(this.active && _root[_root.tohit[i]].active && this.hitTest(_root[_root.tohit[i]]._x,_root[_root.tohit[i]]._y,true))
  55.          {
  56.             _root.do_sound("sHeart-stone",true);
  57.             rem(2,_root.tohit[i]);
  58.          }
  59.          i++;
  60.       }
  61.    }
  62. }
  63.